
import java.util.ArrayList;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author TQNINH
 */
class Student {
    int sCode;
    String sName;
    float sMark;
    
    public Student() {
        
    }
    
    public Student(int c, String n, float m) {
        this.sCode = c;
        this.sName = n;
        this.sMark = m;
    }
}

public class Ex_2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Student s1 = new Student(1, "Ninh", 18.7F);
        Student s2 = new Student(2, "Tuan", 19);
        ArrayList aList = new ArrayList();
        //ArrayList<Student> aList = new ArrayList<Student>();
        //Khong can ep kieu, vi no chu nong chuyen ve Obj <Student>
        aList.add(s1);
        aList.add(s2);
        System.out.println("Code\tName\t\tMark");
        for(int i = 0;i < aList.size();i++) {
            Student s = (Student)aList.get(i);
            System.out.println(s.sCode + "\t" + s.sName + "\t\t" + s.sMark);
        }
        System.out.println(aList.toString());
    }
}
